package com.changhongit.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.changhongit.base.impl.BaseDaoImpl;
import com.changhongit.dao.ServiceTypeDao;
import com.changhongit.entity.ServiceType;

@Repository("serviceTypeDao")
public class ServiceTypeDaoImpl extends BaseDaoImpl<ServiceType> implements
		ServiceTypeDao {

	public List<ServiceType> findAll() {
		return getSqlSession().selectList("servicetype.findAll");
	}

	public void saveServiceType(ServiceType serviceType) {
		getSqlSession().insert("serviceType.saveServiceType", serviceType);
	}

	public void deleteServiceType(String id) {
		getSqlSession().delete("resources.deleteRoleRescours", id);
	}

	@Override
	public List<ServiceType> findByPid(int pid) {
		return getSqlSession().selectList("servicetype.findByPid",pid);
	}
}
